package com.example.g2daylx2.bvm

import androidx.lifecycle.MutableLiveData
import com.example.lib_base.net.ApiService
import com.example.lib_base.net.entity.CarEntityResult
import com.example.lib_base.net.mvvm.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class QweViewModel @Inject constructor(val apiService: ApiService) :BaseViewModel() {
    val carSuccess = MutableLiveData<CarEntityResult>()

    fun getQwe(spaceType:String){
        httpRequest({apiService.car(spaceType)},{carSuccess.value = it})
    }

    val statusSuccess = MutableLiveData<CarEntityResult>()
    fun getStatus(spaceStatus:String){
        httpRequest({apiService.status(spaceStatus)},{statusSuccess.value = it})
    }

    val areaSuccess = MutableLiveData<CarEntityResult>()
    fun getArea(areaId:Int){
        httpRequest({apiService.area(areaId)},{areaSuccess.value = it})
    }
}